package org.example.demo1.Entity;

import java.util.Date;

public class Novel {
    private int novel_id;
    private String novel_name;
    private int author_id;
    private String cover_url;
    private String introduction;
    private Date publish_time;
    private int update_status;
    private int novel_status;
    private int novel_word_count;
    private int novel_role;
    private String collect_time;
    private String username; // 添加作者用户名字段
    private String group_name; // 添加分组名称字段
    private int total_chapters; // 新增总章数字段
    private int viewed_chapters; // 新增已观看章数字段
    private int view_chapter_id;
    
    // 构造函数
    public Novel() {
    }
    
    public Novel(int novel_id, String novel_name, int author_id, String cover_url, String introduction, Date publish_time) {
        this.novel_id = novel_id;
        this.novel_name = novel_name;
        this.author_id = author_id;
        this.cover_url = cover_url;
        this.introduction = introduction;
        this.publish_time = publish_time;
    }

    public Novel(int novel_id, String novel_name, int author_id, String cover_url, String introduction, Date publish_time, int update_status, int novel_status, int novel_word_count, int novel_role, String username) {
        this.novel_id = novel_id;
        this.novel_name = novel_name;
        this.author_id = author_id;
        this.cover_url = cover_url;
        this.introduction = introduction;
        this.publish_time = publish_time;
        this.update_status = update_status;
        this.novel_status = novel_status;
        this.novel_word_count = novel_word_count;
        this.novel_role = novel_role;
        this.username = username;
    }

    public Novel(int novel_id, String novel_name, int author_id, String cover_url, String introduction, Date publish_time, int update_status, int novel_status, int novel_word_count, int novel_role, String username, String group_name) {
        this.novel_id = novel_id;
        this.novel_name = novel_name;
        this.author_id = author_id;
        this.cover_url = cover_url;
        this.introduction = introduction;
        this.publish_time = publish_time;
        this.update_status = update_status;
        this.novel_status = novel_status;
        this.novel_word_count = novel_word_count;
        this.novel_role = novel_role;
        this.username = username;
        this.group_name = group_name;
    }

    // 新增构造函数，包含 total_chapters 和 viewed_chapters
    public Novel(int novel_id, String novel_name, int author_id, String cover_url, String introduction, Date publish_time, int update_status, int novel_status, int novel_word_count, int novel_role, String collect_time, String username, String group_name, int total_chapters, int viewed_chapters) {
        this.novel_id = novel_id;
        this.novel_name = novel_name;
        this.author_id = author_id;
        this.cover_url = cover_url;
        this.introduction = introduction;
        this.publish_time = publish_time;
        this.update_status = update_status;
        this.novel_status = novel_status;
        this.novel_word_count = novel_word_count;
        this.novel_role = novel_role;
        this.collect_time = collect_time;
        this.username = username;
        this.group_name = group_name;
        this.total_chapters = total_chapters;
        this.viewed_chapters = viewed_chapters;
    }

    public int getTotal_chapters() {
        return total_chapters;
    }

    public void setTotal_chapters(int total_chapters) {
        this.total_chapters = total_chapters;
    }

    public int getViewed_chapters() {
        return viewed_chapters;
    }

    public void setViewed_chapters(int viewed_chapters) {
        this.viewed_chapters = viewed_chapters;
    }

    public String getCollect_time() {
        return collect_time;
    }

    public void setCollect_time(String collect_time) {
        this.collect_time = collect_time;
    }

    public int getNovel_word_count() {
        return novel_word_count;
    }

    public void setNovel_word_count(int novel_word_count) {
        this.novel_word_count = novel_word_count;
    }

    public int getNovel_role() {
        return novel_role;
    }

    public void setNovel_role(int novel_role) {
        this.novel_role = novel_role;
    }

    public int getUpdate_status() {
        return update_status;
    }

    public void setUpdate_status(int update_status) {
        this.update_status = update_status;
    }

    public int getNovel_status() {
        return novel_status;
    }

    public void setNovel_status(int novel_status) {
        this.novel_status = novel_status;
    }

    // getter和setter方法
    public int getNovel_id() {
        return novel_id;
    }

    public void setNovel_id(int novel_id) {
        this.novel_id = novel_id;
    }

    public String getNovel_name() {
        return novel_name;
    }

    public void setNovel_name(String novel_name) {
        this.novel_name = novel_name;
    }

    public int getAuthor_id() {
        return author_id;
    }

    public void setAuthor_id(int author_id) {
        this.author_id = author_id;
    }

    public Date getPublish_time() {
        return publish_time;
    }

    public void setPublish_time(Date publish_time) {
        this.publish_time = publish_time;
    }

    public String getCover_url() {
        return cover_url;
    }

    public void setCover_url(String cover_url) {
        this.cover_url = cover_url;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    // 添加username的getter和setter
    public String getUsername() {
        return username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    
    // 添加group_name的getter和setter
    public String getGroup_name() {
        return group_name;
    }
    
    public void setGroup_name(String group_name) {
        this.group_name = group_name;
    }
    
    @Override
    public String toString() {
        return "Novel{" +
                "novel_id=" + novel_id +
                ", novel_name='" + novel_name + '\'' +
                ", author_id=" + author_id +
                ", cover_url='" + cover_url + '\'' +
                ", introduction='" + introduction + '\'' +
                ", publish_time=" + publish_time +
                ", username='" + username + '\'' +
                ", group_name='" + group_name + '\'' +
                ", total_chapters=" + total_chapters +
                ", viewed_chapters=" + viewed_chapters +
                '}';
    }
}
